package org.coco24.pmgame.pack

import com.badlogic.gdx.utils.Array

class LevelMoveSet : Array<LevelMove>()
{
    fun add(level: Int, moveNum: Int)
    {
        add(LevelMove(level, moveNum))
    }

    fun add(level: Int, moveInternalName: String)
    {
        add(LevelMove(level, moveInternalName))
    }

    fun add(level: Int, move: Move)
    {
        add(LevelMove(level, move))
    }

    fun getByLevel(level: Int): Array<Move>
    {
        val returnVal = Array<Move>()
        for (levelMove in this)
        {
            if (levelMove.level == level)
            {
                returnVal.add(levelMove.move)
            }
        }
        return returnVal
    }

    fun getByUnderLevel(level: Int): LevelMoveSet
    {
        val returnVal = LevelMoveSet()
        for (levelMove in this)
        {
            if (levelMove.level <= level)
            {
                returnVal.add(levelMove)
            }
        }
        return returnVal
    }
}